<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<!-- 2. 点击登陆 弹出登录框点击X关闭登录框 -->

<body>
    <div id="app">
        <button @click="add">登录</button>
        <ul id="list" v-show="list">
            <li><input type="text"></li>
            <li><input type="text"></li>
            <button @click="abb">X</button>
        </ul>

    </div>
    </div>
</body>
<script>
    const { createApp, ref } = Vue;

    createApp({
        setup() {
            const list = ref(false);

            function add() {
                list.value = true;
            }

            function abb() {
                list.value = false;
            }
            return {
                add,
                abb,
                list
            }
        }
    }).mount('#app')
</script>

</html>